package com.visizen.wisdomclass.server.client;

import com.visizen.wisdomclass.server.model.WcCourseSchedual;
import com.visizen.wisdomclass.server.model.WcCourseSchedualExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface WcCourseSchedualMapper {
    @SelectProvider(type=WcCourseSchedualSqlProvider.class, method="countByExample")
    int countByExample(WcCourseSchedualExample example);

    @DeleteProvider(type=WcCourseSchedualSqlProvider.class, method="deleteByExample")
    int deleteByExample(WcCourseSchedualExample example);

    @Delete({
        "delete from wc_course_schedual",
        "where ID = #{ID,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long ID);

    @Insert({
        "insert into wc_course_schedual (ID, CLASS_ID, ",
        "W0, W1, W2, ",
        "W3, W4, W5, ",
        "W6, FLAG, TERM_ID)",
        "values (#{ID,jdbcType=BIGINT}, #{CLASS_ID,jdbcType=BIGINT}, ",
        "#{w0,jdbcType=BIGINT}, #{w1,jdbcType=BIGINT}, #{w2,jdbcType=BIGINT}, ",
        "#{w3,jdbcType=BIGINT}, #{w4,jdbcType=BIGINT}, #{w5,jdbcType=BIGINT}, ",
        "#{w6,jdbcType=BIGINT}, #{FLAG,jdbcType=INTEGER}, #{TERM_ID,jdbcType=BIGINT})"
    })
    int insert(WcCourseSchedual record);

    @InsertProvider(type=WcCourseSchedualSqlProvider.class, method="insertSelective")
    int insertSelective(WcCourseSchedual record);

    @SelectProvider(type=WcCourseSchedualSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="ID", property="ID", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="CLASS_ID", property="CLASS_ID", jdbcType=JdbcType.BIGINT),
        @Result(column="W0", property="w0", jdbcType=JdbcType.BIGINT),
        @Result(column="W1", property="w1", jdbcType=JdbcType.BIGINT),
        @Result(column="W2", property="w2", jdbcType=JdbcType.BIGINT),
        @Result(column="W3", property="w3", jdbcType=JdbcType.BIGINT),
        @Result(column="W4", property="w4", jdbcType=JdbcType.BIGINT),
        @Result(column="W5", property="w5", jdbcType=JdbcType.BIGINT),
        @Result(column="W6", property="w6", jdbcType=JdbcType.BIGINT),
        @Result(column="FLAG", property="FLAG", jdbcType=JdbcType.INTEGER),
        @Result(column="TERM_ID", property="TERM_ID", jdbcType=JdbcType.BIGINT)
    })
    List<WcCourseSchedual> selectByExample(WcCourseSchedualExample example);

    @Select({
        "select",
        "ID, CLASS_ID, W0, W1, W2, W3, W4, W5, W6, FLAG, TERM_ID",
        "from wc_course_schedual",
        "where ID = #{ID,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="ID", property="ID", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="CLASS_ID", property="CLASS_ID", jdbcType=JdbcType.BIGINT),
        @Result(column="W0", property="w0", jdbcType=JdbcType.BIGINT),
        @Result(column="W1", property="w1", jdbcType=JdbcType.BIGINT),
        @Result(column="W2", property="w2", jdbcType=JdbcType.BIGINT),
        @Result(column="W3", property="w3", jdbcType=JdbcType.BIGINT),
        @Result(column="W4", property="w4", jdbcType=JdbcType.BIGINT),
        @Result(column="W5", property="w5", jdbcType=JdbcType.BIGINT),
        @Result(column="W6", property="w6", jdbcType=JdbcType.BIGINT),
        @Result(column="FLAG", property="FLAG", jdbcType=JdbcType.INTEGER),
        @Result(column="TERM_ID", property="TERM_ID", jdbcType=JdbcType.BIGINT)
    })
    WcCourseSchedual selectByPrimaryKey(Long ID);

    @UpdateProvider(type=WcCourseSchedualSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") WcCourseSchedual record, @Param("example") WcCourseSchedualExample example);

    @UpdateProvider(type=WcCourseSchedualSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") WcCourseSchedual record, @Param("example") WcCourseSchedualExample example);

    @UpdateProvider(type=WcCourseSchedualSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(WcCourseSchedual record);

    @Update({
        "update wc_course_schedual",
        "set CLASS_ID = #{CLASS_ID,jdbcType=BIGINT},",
          "W0 = #{w0,jdbcType=BIGINT},",
          "W1 = #{w1,jdbcType=BIGINT},",
          "W2 = #{w2,jdbcType=BIGINT},",
          "W3 = #{w3,jdbcType=BIGINT},",
          "W4 = #{w4,jdbcType=BIGINT},",
          "W5 = #{w5,jdbcType=BIGINT},",
          "W6 = #{w6,jdbcType=BIGINT},",
          "FLAG = #{FLAG,jdbcType=INTEGER},",
          "TERM_ID = #{TERM_ID,jdbcType=BIGINT}",
        "where ID = #{ID,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(WcCourseSchedual record);
}